<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
	<title>个人中心</title>

	<link rel="stylesheet" type="text/css" href="../addons/zh_yjm/template/mobile/css/index.css">
	<link rel="stylesheet" type="text/css" href="../addons/zh_yjm/template/mobile/css/jquery-weui.css">
	<link rel="stylesheet" type="text/css" href="../addons/zh_yjm/template/mobile/css/weui.min.css">

	<style type="text/css">
		iframe{
			position: fixed;
			bottom: 0;
			left: 0;
			background: #fff;
			z-index: 999;	
		}
		.footer a:hover{
			color: red;
		}
		.weui-cells{
			position: static;
		}
		.footer{
      width: 100%;
      overflow: hidden;
      display: flex;
      height: 6rem;
      padding: 1rem 0;
      border-top: 0.05rem solid #ccc;
      position: fixed;
      bottom: 0;
      left: 0;
    }
    .footer a{
      float: left;
      display: block;
      /*width: 33%;*/
      color: #333;
      text-align: center;
      text-decoration: none;
    }
    .footer a img{
      display: inline-block;
      width:3rem;
      height:3rem;
    }
    .footer a p{
      text-align: center;
      font-size: 1.5rem;
      line-height: 3.8rem;
      margin:0;
    }

    .footer a:hover , .footer a:active{
      color: red;
    }
	</style>
</head>
<body>
	<div class="container">
		<div class="member_top">
			<div class="photo_box">
				<img class="tx_photo" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1656562954,584009141&fm=11&gp=0.jpg">
			</div>

			<p class="username">赵丽颖</p>
		</div>

		<div class="weui-cells">
		  <div class="weui-cell">
		    <div class="weui-cell__bd">
		      <p class='title'>我的服务店</p>
		    </div>
		  </div>
		</div>

		<div class="weui-cells storeList">
			<div class="noData">
				<img src="../addons/zh_yjm/template/mobile/images/noData.png">
				<p>暂无数据</p>
			</div>
		  <!-- <div class="weui-cell list">
		    <div class="weui-cell__hd list_left"><img src="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1377916489,1349405445&fm=26&gp=0.jpg"></div>
		    <div class="weui-cell__bd list_title">
		      <p style="font-weight: bold;line-height: 3rem;height: 3rem ;">志汇科技美容店志汇科技美容店志汇科技美容店志汇科技美容店志汇科技美容店</p>
		      <p class="list_txt">美容店</p>

		      <p class="tag">
				<a>余额600</a>
				<a href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=account&m=zh_yjm">消费记录</a>
		      </p>
		    </div>
		    <div class="weui-cell__ft list_right">600m</div>
		  </div>

		  <div class="weui-cell list">
		    <div class="weui-cell__hd list_left"><img src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1656562954,584009141&fm=11&gp=0.jpg"></div>
		    <div class="weui-cell__bd list_title">
		      <p style="font-weight: bold;line-height: 3rem;height: 3rem ;">志汇科技美容店志汇科技美容店志汇科技美容店志汇科技美容店志汇科技美容店</p>
		      <p class="list_txt">美容店</p>

		      <p class="tag">
				<a href="">余额600</a>
				<a>消费记录</a>
		      </p>
		    </div>
		    <div class="weui-cell__ft list_right">600m</div>
		  </div> -->


		</div>
	</div>

	<!-- <iframe name="iframe3" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no src="footer.html" height="auto" width="100%"></iframe> -->
	<!-- <iframe name="iframe3" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no src="../addons/zh_yjm/template/mobile/footer.html" height="auto" width="100%"></iframe> -->
	<div class="footer" id="footer" style="background-color:#fff;" >
	    {loop $menus $row}
      <a {if $total==2}style="width:50%"{/if}  {if $total==3}style="width:33%"{/if}   {if $total==4}style="width:25%"{/if}   {if $total==5}style="width:20%"{/if} href="{$row['link']}">
	        <img src="{$_W['attachurl']}{$row['img']}">
	        <p>{$row['title']}</p>
	      </a>
	    {/loop}

	</div>
</body>

<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/jquery-2.1.4.js'></script>
<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/index.js'></script>
<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/jquery-weui.js'></script>
<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/jquery-weui.min.js'></script>
<script type="text/javascript">
var phone;
var lat = sessionStorage.getItem("lat");
var lng = sessionStorage.getItem("lng");
// var lat  //纬度
// var lng  //经度
$(function () {
	$.ajax({
            type:"get",
            url:"{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=Userinfo&m=zh_yjm",
            async:true,
            dataType:"json",
            data:{},
            success:function(data){
            	console.log(data)
            	// alert(data.res.phone)
            	if(data.code==500){
            		window.location.href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=register&m=zh_yjm"
            	}else if(data.code==200){
			            	// alert(1234)
	               	$(".tx_photo").attr("src","{$_W['attachurl']}/"+data.res.avatar)
	               	$(".username").html(data.res.nickname)
	               	phone=data.res.phone
					console.log(phone)
					sessionStorage.setItem("phone",phone);
					$.ajax({
			            type:"get",
			            url:"{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=Memberstore&m=zh_yjm",
			            async:true,
			            dataType:"json",
			            data:{lat:lat,lng:lng,phone:phone},
			            success:function(data){
			            	// alert(123)
			            	console.log(data)
			               if(data.code==200){
			               		for (var i =0 ;i<data.data.length;i++) {
			               			var str="<div class='weui-cell list'><input class='hide_id' type='hidden' value="+data.data[i].id+" /><input class='hide_money' type='hidden' value="+data.data[i].money+" /> <div class='weui-cell__hd list_left'><img src='{$_W['siteroot']}/attachment/"+data.data[i].img+"'></div> <div class='weui-cell__bd list_title'><p style='font-weight: bold;line-height: 3rem;height: 3rem ;'>"+data.data[i].name+"</p><p class='list_txt'>"+data.data[i].area+"</p> <p class='tag'><a>余额"+data.data[i].money+"</a> <a href='{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=account&m=zh_yjm&id="+data.data[i].id+"'>消费记录</a> </p> </div> <div class='weui-cell__ft list_right'>"+data.data[i].juli+"m</div> </div>'"

			               			$(".storeList").append(str)
			               		}
			               	}else if(data.code==500){
			               		$(".noData").css("display",'block')
			               }
			            },

			            // error : function(data) {

			            //     alert(data.msg);

			            //     return false

			            // }
			        })
	
	// getLocation()
	// showPosition()

		            
            	}
            },

            // error : function(data) {

            //     alert(data.msg);

            //     return false

            // }
        })

	
	
})



	 // function getLocation(){
  //       if (navigator.geolocation){
  //           navigator.geolocation.getCurrentPosition(showPosition);
  //       }else{
  //           alert('浏览器已拒绝获取位置信息')
  //       }
  //   }
    // function showPosition(position){
    //     lat=position.coords.latitude;
    //     lng=position.coords.longitude;
    //    	// alert('纬度：'+lat+','+'经度:'+lng)
       				
    // }

    $(".storeList").on('click',".list",function () {
    	var id=$(this).children(".hide_id").val()
    	var money=$(this).children(".hide_money").val()
    	console.log(id)
    	console.log(money)
	    sessionStorage.setItem("money",money);

    	window.location.href="{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&do=store&m=zh_yjm&id="+id
    })
    	

    </script>
</html>